package com.example.mode.factoryMode.factoryMethod;

import com.example.mode.factoryMode.Human;

/**
 * Created with IntelliJ IDEA.
 * User: yf-wenhao
 * Date: 2019/3/26
 * Time: 下午5:46
 * 缺点需要集成大量的类 不好维护，客户端需要知道每一个工厂与类
 */
public class FactoryMethodTest {

    public static void main(String[] args) {
        Factory factory1 = new BlackHumanFactory();
        Human human1 = factory1.create();
        human1.color();
        human1.talk();


        Factory factory2 = new WhiteHumanFactory();
        Human human2 = factory2.create();
        human2.talk();
        human2.color();

    }

}
